package com.example.mybatisplus.model.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 学校用户白名单设置
 * </p>
 *
 * @author sharplu
 * @since 2023-07-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("wcss_whitelist_setting")
@ApiModel(value = "WhitelistSetting对象", description = "学校用户白名单设置")
public class WhitelistSetting extends Model<WhitelistSetting> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "限定用户SN")
    private String sn;

    private String password;

    @ApiModelProperty(value = "用户名")
    private String name;

    @ApiModelProperty(value = "用户角色id")
    private Long roleId;

    @TableField("is_enabled")// 用原生api的时候会自动取别名
    private Integer enabled;

    @TableLogic// 就是逻辑删除注解  写了这个注解，这个类就是逻辑删除
    @TableField("is_deleted")
    private Integer deleted;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime gmtCreated;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime gmtModified;

    public WhitelistSetting(String userSn, String userName, Long roleId) {
        this.sn = userSn;
        this.name = userName;
        this.roleId = roleId;
    }

    public WhitelistSetting(){}


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
